<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <!-- 我是注释 -->
  我是文本,呵呵呵
  <div class="box">哈哈哈</div>
  <ul>
    <li>1</li>
    <li>2</li>
    <li>3</li>
    <li>4</li>
    <li>5</li>
  </ul>
  <script>
    var htmlEl = document.documentElement
    var bodyEl = document.body
    var headEl = document.head
    var doctype = document.doctype // 文档声明 <!DOCTYPE html>

    // 1.获取节点的导航
    var bodyEl = document.body
    // 1.1获取所有的子节点
    console.log(bodyEl.childNodes)
    // 1.2获取body的第一个子节点
    var bodyFirstChild = bodyEl.firstChild
    // 1.3获取body中的注释
    var bodyElCommentChild = bodyFirstChild.nextSibling
    console.log(bodyElCommentChild)
    // 1.4获取body的父节点
    console.log(bodyEl.parentNode)

  </script>
</body>

</html>